$(function () {

    $("#pandian2").click(function () {

        var name = $("#pandian1").val();

        var store = $("#store").val();

        var pageNum = 1;
        var pageSize = 3;

        window.location = "/pandian/StartCount.do?name=" + name + "" +
            "&store=" + store + "&pageNum=" + pageNum + "&pageSize=" + pageSize;


        $.ajax({
            url: "/pandian/StartCount.do",
            data: "name=" + name + "&store=" + store + "&pageNum=" + pageNum + "&pageSize=" + pageSize,
            dataType: "json",
            success: function (data) {
                console.log(JSON.stringify(data));
                //清空
                $("#div1").html("");

                $("#div1").append("<tr>\n" +
                    "        <td>仓库名称</td>\n" +
                    "        <td>货主</td>\n" +
                    "        <td>仓位</td>\n" +
                    "        <td>托盘</td>\n" +
                    "        <td>货物名称</td>\n" +
                    "        <td>货物规格</td>\n" +
                    "        <td>出库件数</td>\n" +
                    "        </tr>");

                if (data.list.length == 0) {
                    $("#div1").append("<tr><td>没有找到记录</td></tr>");
                } else {
                    for (var i = 0; i < data.list.length; i++) {
                        $("#div1").append("<tr>" +
                            "<td>" + data.list[i].storeName + "</td>" +
                            "<td>" + data.list[i].custName + "</td>" +
                            "<td>" + data.list[i].siteCode + "</td>" +
                            "<td>" + data.list[i].trayCode + "</td>" +
                            "<td>" + data.list[i].detailsGoodsName + "</td>" +
                            "<td>" + data.list[i].detailsGoodsSpec + "</td>" +
                            "<td>" + data.list[i].detailsGoodsNum + "</td>" +
                            "</tr>");
                    }
                }

            }
        })
    })

    function shang() {

    }

    function xia() {

    }


    // <table border="1" cellspacing="0">
    //     <tr>
    //     <td class="t1" colspan="7">没有找到记录</td>
    //     </tr>
    //
    //     <tr>
    //     <td>仓库名称</td>
    //     <td>货主</td>
    //     <td>仓位</td>
    //     <td>托盘</td>
    //     <td>货物名称</td>
    //     <td>货物规格</td>
    //     <td>出库件数</td>
    //     </tr>
    //
    //     <tr th:each="every:${session.pageInfo.getList()}">
    //     <td th:text="${every.getStoreName()}"></td>
    //     <td th:text="${every.getCustName()}"></td>
    //     <td th:text="${every.getSiteCode()}"></td>
    //     <td th:text="${every.getTrayCode()}"></td>
    //     <td th:text="${every.getDetailsGoodsName()}"></td>
    //     <td th:text="${every.getDetailsGoodsSpec()}"></td>
    //     <td th:text="${every.getDetailsGoodsNum()}"></td>
    //     </tr>
    //     </table>
    //
})